package com.serviceprovider.business.module.admin.user.model;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.admin.role.model.Role;

import org.springmodules.validation.bean.conf.loader.annotation.handler.Email;
import org.springmodules.validation.bean.conf.loader.annotation.handler.Length;
import org.springmodules.validation.bean.conf.loader.annotation.handler.NotBlank;

/**
 * User domain object.
 */
public class OldUser extends Saveable {
    private static final long serialVersionUID = -7565761473247893844L;

    /**
     * If the user is enabled.
     */
    private Boolean enabled = new Boolean(true);
    private Boolean deleted = new Boolean(true);

    /**
     * User role.
     */
    private Role role = new Role();

    /**
     * User profile.
     */
    private UserProfile profile = new UserProfile();

    /**
     * This field is used for form validation only
     */
    @NotBlank
    @Length(min = 6)
    private String confirmPassword;

    /**
     * User email.
     */
    @NotBlank
    @Email
    private String email;

    /**
     * Email GUID. Used for user confirmation.
     */
    private String emailGUID;
    private int    level1UserID;

    /**
     * User password. MD5 hashed.
     */
    @NotBlank
    @Length(min = 6)
    private String  password;
    private Boolean showGui;

    public int getLevel1UserID() {
        return level1UserID;
    }

    public void setLevel1UserID(int level1UserID) {
        this.level1UserID = level1UserID;
    }

    public Boolean getShowGui() {
        return showGui;
    }

    public void setShowGui(Boolean showGui) {
        this.showGui = showGui;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getConfirmPassword() {
        return confirmPassword;
    }

    public void setConfirmPassword(String pwd) {
        if (!pwd.equals(this.password)) {
            confirmPassword = null;
        }

        confirmPassword = pwd;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public String getEmailGUID() {
        return emailGUID;
    }

    public void setEmailGUID(String emailGUID) {
        this.emailGUID = emailGUID;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public UserProfile getProfile() {
        return profile;
    }

    public void setProfile(UserProfile profile) {
        this.profile = profile;
    }
}



